package com.jt.controller;

import com.jt.pojo.User;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@Controller  //将类交给springMVC管理
@ResponseBody  //要求当前类中的所有方法，都返回字符串

@RestController    //@ResponseBody + @Controller
@RequestMapping("/rest")
@CrossOrigin      //允许跨域
public class ResUserController {


    /**
     *
     */
    @RequestMapping("/findJSON")
    public User findUser(User user){

        user.setSex("女");
        user.setId(105);
        return user;
    }

}
